package com.snack.system.service.impl;

import com.snack.system.domain.TsOrderGoods;
import com.snack.system.mapper.TsOrderGoodsMapper;
import com.snack.system.service.ITsOrderGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 订单关联商品Service业务层处理
 * 
 * @author snack
 * @date 2022-09-18
 */
@Service
public class TsOrderGoodsServiceImpl implements ITsOrderGoodsService 
{
    @Autowired
    private TsOrderGoodsMapper orderGoodsMapper;

    /**
     * 查询订单关联商品
     * 
     * @param orderGoodsId 订单关联商品主键
     * @return 订单关联商品
     */
    @Override
    public TsOrderGoods selectById(Long orderGoodsId)
    {
        return orderGoodsMapper.selectById(orderGoodsId);
    }

    /**
     * 查询订单关联商品列表
     * 
     * @param orderGoods 订单关联商品
     * @return 订单关联商品
     */
    @Override
    public List<TsOrderGoods> selectList(TsOrderGoods orderGoods)
    {
        return orderGoodsMapper.selectList(orderGoods);
    }

    /**
     * 新增订单关联商品
     * 
     * @param orderGoods 订单关联商品
     * @return 结果
     */
    @Override
    public int insert(TsOrderGoods orderGoods)
    {
        return orderGoodsMapper.insert(orderGoods);
    }

    /**
     * 修改订单关联商品
     * 
     * @param orderGoods 订单关联商品
     * @return 结果
     */
    @Override
    public int update(TsOrderGoods orderGoods)
    {
        return orderGoodsMapper.update(orderGoods);
    }

    /**
     * 批量删除订单关联商品
     * 
     * @param orderGoodsIds 需要删除的订单关联商品主键
     * @return 结果
     */
    @Override
    public int deleteByIds(Long[] orderGoodsIds)
    {
        return orderGoodsMapper.deleteByIds(orderGoodsIds);
    }

}
